<html>
	
	<!-- 
			IMPORTANT
			
			To setup the title of the page use find/replace, 
			and replace 'How to compile IoC DLL file' by the html text of your title
			
			To setup the link which make the page return the the with-frame content
			use find/replace and replace 'YourFileNameHere' by the 
	-->
	
	<head>
		<title>How to compile IoC DLL file - LowRA API Documentation</title>
		<link rel="stylesheet" href="../style.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="../print.css" type="text/css" media="print" />
        <link rel="stylesheet" href="../prettify.css" type="text/css"  />
		<script language="javascript" type="text/javascript" src="../asdoc.js"></script>
		<script type="text/javascript" language="javascript" src="../prettify.js"></script>

	</head>
	<body>
		<script type="text/javascript" language="javascript">
		<!--
			asdocTitle = 'How to compile IoC DLL file - LowRA API Documentation';
			var baseRef = '../';
			window.onload = configPage;
		--></script>
		
		<table id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
			<tr>
				
				<td align="left" class="titleTableTitle">LowRA API Documentation</td>
				<td align="right" class="titleTableTopNav">
					<a 	onclick="loadClassListFrame('../all-classes.html')" 
					   	href="../annexes.html">Annexes</a>&nbsp;|&nbsp;
                    <a 	onclick="loadClassListFrame('../all-classes.html')" 
					   	href="../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;
					<a 	onclick="loadClassListFrame('../all-classes.html')" 
						href="../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;
					<a 	onclick="loadClassListFrame('../index-list.html')" 
						href="../all-index-A.html">Index</a>&nbsp;|&nbsp;
					<a 	href="../index.html?howto/howto-compile-dll.html&amp;all-classes.html" id="framesLink1">Frames</a>
					<a 	onclick="parent.location=document.location" 
						href="" 
						style="display:none;" 
						id="noFramesLink1">No&nbsp;Frames</a>
						
				</td>
				<td rowspan="3" align="right" class="titleTableLogo">
					<img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../images/logo.jpg">
				</td>
			</tr>
			<tr class="titleTableRow2">
				<td align="left" id="subTitle" class="titleTableSubTitle">
					How to compile IoC DLL file
		    </td>	
				<td class="titleTableSubTitle">&nbsp;</td>		
			</tr>
			<tr class="titleTableRow3">
				<td colspan="2">&nbsp;</td>
			</tr>
		</table
		
		
		><script type="text/javascript" language="javascript">
		<!--
		if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) 
		{
			titleBar_setSubTitle("How to compile IoC DLL file");
			
			titleBar_setSubNav(false,	false,	   false,
							   false,   false,	   false,
							   false,   false,	   false,
							   false,   false,	   false,
							   false,   false
							   );
		}
		--></script>
		
		<div class="MainContent">
			<h1>Summary</h1>

<ol>
	<li><a href="#overview">Overview</a></li>
	<li><a href="#ant">Ant task</a></li>
	<li><a href="#ide">Flash IDE</a></li>
	<li><a href="#information">Informations</a></li>
	</ol>
<p>&nbsp;</p>

		<a name="overview"></a>
          <h1>Overview</h1>
            <p>
              You will find below the  various methods to build  DLL file for LowRA IoC.
            </p>
            <p>A dll file is usually compiled to contain a set of objects and using them in an IoC. <br>
            These files usually contain class does not inherit Sprite, and usually the entry point of these files do not reference the classes in it. </p>
          <p>All informations concerning the Ant tasks directly from the C&eacute;dric's <a href="http://book.abe.free.fr/blog/?post/2008/02/04/Didacticiel-Ant">blog article</a></p>
          <p>&nbsp;</p>
          <a name="ant" id="ant"></a>
          <h1>ANT Task</h1>
            <p>
            You must be comfortable with the use of Ant Tasks before reading this paragraph.</p>
            <p>We will create a set of tasks dedicated to compiling dll.<br>
            These tasks will be responsible for :</p>
            <ul>
              <li>Create a temporary extension of the class flash.display.Sprite</li>
              <li>Compile dll with this temporary entry.</li>
              <li>Delete the temporary entry.</li>
            </ul>
            <p>To compile our dll we need a class that will serve as an entry point to swf.<br>
            This class will be automatically generated by the task, so we can ensure that the dll will be compiled, even if the creator of the task did not create an entry point for its dll.</p>
            <p>The creation of the temporary file is done simply by an echo of the code of the class in a file with the same name located in the source directory. <br>
            In this task property <span class="prettyprint"><code>${tempfile}</code></span>is the name of the class and <code>${src}</code> to the directory where the sources of the project. <br>
            The use of an external variable to define the name of the class is important, because that enables all these tasks to find the right file.</p>
            <div class="listing">
              <pre class="prettyprint">&lt;target name=&quot;dll.CreateTempEntry&quot;&gt;<br>	&lt;echo file=&quot;${src}/${tempfile}.as&quot;&gt;package<br>{<br>	import flash.display.Sprite;<br>	public class ${tempfile} extends Sprite {}<br>}<br>	&lt;/echo&gt;<br>&lt;/target&gt;</pre>
            </div>
            <p>Removing the temporary file now :</p>
            <div class="listing">
              <pre class="prettyprint">&lt;target name=&quot;dll.CleanTempEntry&quot;&gt;<br>	&lt;delete&gt;<br>		&lt;fileset file=&quot;${src}/${tempfile}.as&quot;/&gt;<br>	&lt;/delete&gt;<br>&lt;/target&gt;</pre></div>
            <p>Now we have to compile this temporary class using your custom compile task.<br>
            Here I use the iFac plugin to compile all my swf ( just an example ) :</p>
            <div class="listing">
              <pre class="prettyprint">&lt;target name=&quot;fcsh.Compile&quot;&gt;<br>
	&lt;condition property=&quot;includes.arg&quot; value=&quot;-includes='${includes}'&quot; else=&quot;&quot;&gt;
		&lt;isset property=&quot;includes&quot;/&gt;
	&lt;/condition&gt;
	
	&lt;ifac failonerror=&quot;true&quot; delay=&quot;${iFac.delay}&quot;&gt;
   	&lt;arg value=&quot;mxmlc&quot;/&gt;
		&lt;arg value=&quot;-load-config='${flex.config}'&quot;/&gt;
	
		&lt;arg value=&quot;-source-path+='src'&quot;/&gt;
		&lt;arg value=&quot;-source-path+='${lowra.src}'&quot;/&gt;<br>	
		&lt;arg value=&quot;${includes.arg}&quot;/&gt;
	
		&lt;arg value=&quot;-output='${output}'&quot;/&gt;<br>
		&lt;arg value=&quot;'${main}'&quot;/&gt;<br>
	&lt;/ifac&gt;
&lt;/target&gt;</pre>
            </div>
            <p> Ok now, I have task to create entry point, to remove this entry point and a task to compile my swf.<br>
              Creates now a more global task which 
              call all this three sub task : <br>
            </p>
            <div class="listing">
              <pre class="prettyprint">&lt;target name=&quot;dll.Compile&quot;&gt;
	&lt;property name=&quot;tempfile&quot; value=&quot;DLLEntryPoint&quot;/&gt;                <br>
  &lt;antcall target=&quot;dll.CreateTempEntry&quot;&gt;
  	&lt;param name=&quot;src&quot; value=&quot;${src.dir}&quot;/&gt;
  	&lt;param name=&quot;tempfile&quot; value=&quot;${tempfile}&quot;/&gt;
  &lt;/antcall&gt;<br>
  &lt;antcall target=&quot;fcsh.Compile&quot;&gt;
  	&lt;param name=&quot;src&quot; value=&quot;${src.dir}/${tempfile}.as&quot;/&gt;
  	&lt;param name=&quot;output&quot; value=&quot;${name}.swf&quot;/&gt;
  &lt;/antcall&gt;<br>
  &lt;antcall target=&quot;dll.CleanTempEntry&quot;&gt;
  	&lt;param name=&quot;src&quot; value=&quot;${src.dir}&quot;/&gt;
  	&lt;param name=&quot;tempfile&quot; value=&quot;${tempfile}&quot;/&gt;
  &lt;/antcall&gt;
&lt;/target&gt;</pre>
</div>
            <p>Everything is almost done ... it lacks only the class definition to be included in the compilation ( the &quot;include&quot; argument ).<br>
            So finally, we will create the task to build a dedicated DLL ( for example, a <strong>CSSDesrializer</strong> DLL )  :</p>
            <div class="listing">
              <pre class="prettyprint">&lt;target name=&quot;dll.Deserializer.compile()&quot;&gt;<br>	&lt;antcall target=&quot;dll.Compile&quot;&gt;<br>		&lt;param name=&quot;name&quot; value=&quot;CSSDeserializerDll&quot;/&gt;<br>		&lt;param name=&quot;bin&quot; value=&quot;${bin.dir}&quot;/&gt;<br>		&lt;param name=&quot;includes&quot; value=&quot;com.bourre.encoding.CSSDeserializer&quot;/&gt;<br>	&lt;/antcall&gt;<br>&lt;/target&gt;</pre>
            </div>
            <p>And that's all !</p>
          <p>&nbsp;</p>
             <a name="ide" id="ide"></a>
          <h1>Flash IDE</h1>
            <p>
            You don't know Ant task, and you want to compile dll file using the Flash IDE, no problem.</p>
            <p>Create a new Flash document ( Player 9 / ActionScript 3 ).<br>
            In the first frame, insert this following ActionScript code :          </p>
          <div class="listing">
              <pre class="prettyprint">import com.bourre.encoding.CSSDeserializer;

var dll : CSSDesrializer;</pre></div>
          <p>Export your swf and that's all ;)</p>
          <p>&nbsp;</p>
             <a name="information" id="information"></a>
          <h1>Informations</h1>
            <p>
            All informations concerning the Ant tasks directly from the C&eacute;dric's blog article  (thank you sir).<br>
            You can find many Ant tasks on
            <a href="http://book.abe.free.fr/blog/?post/2008/02/04/Didacticiel-Ant">his blog</a> too ( asdoc, &lt;script&gt; node, properties file, and more... )</p>
		</div>
		
        <div class="feedbackLink">
            <p>&nbsp;</p>
            <center>
            <a target="_blank" href="http://code.google.com/p/lowra/issues/entry">Submit Feedback</a>
            </center>
            </div>
            <center class="copyright">LowRA API documentation 2008- 2009<br>Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1</center>
        </div>
	</body>
</html>